/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pin.db.connectionPool;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.sql.PooledConnection;
import javax.sql.StatementEvent;

/**
 *
 * @author huxiaodi
 */
public class PinStatementEvent extends StatementEvent {

    public final static int EVENT_CREATE = 0,  EVENT_OPEN = 1,  EVENT_CLOSE = 2,  EVENT_DESTROY = 3;
    private int eventType;
    private long eventTime;

    public long getEventTime() {
        return eventTime;
    }

    public int getEventType() {
        return eventType;
    }

    public PinStatementEvent(PooledConnection con, PreparedStatement statement, SQLException exception, int eventType) {
        super(con, statement, exception);
        this.eventType = eventType;
        eventTime = System.currentTimeMillis();
    }

    public PinStatementEvent(PooledConnection con, PreparedStatement statement, int eventType) {
        super(con, statement);
        this.eventType = eventType;
        eventTime = System.currentTimeMillis();
    }
}
